from wsgiref import headers
import requests
import sys
import json
sys.append("..")
import requests_header

def check_cookie(cookies):
    requests_header.RequestsHeader headers
    headers.setUserAgent(__OJ_UA)
    rep = requests.get("http://hfoj.net/api/profile", headers=headers.read(), cookies=cookies)
    repj = json.loads(rep)
    if rep['data'] == None:
        return False
    else:
        return True